﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.ExpressApp.Web.Templates;
using DevExpress.ExpressApp.Demos;
using FeatureCenter.Module.Web.InfoPanels;
using DevExpress.ExpressApp.Templates;

public partial class Default : BaseXafPage, IHintTemplate, ICustomControlsPlaceHolder {
    private void CallbackManager_PreRender(object sender, EventArgs e) {
        FeatureCenter.Web.DefaultVerticalTemplateContent content = TemplateContent as FeatureCenter.Web.DefaultVerticalTemplateContent;
        if(content != null) {
            content.UpdateToolsRoundPanelVisibility();
        }
    }
    public override Control InnerContentPlaceHolder {
        get {
            return this.Content;
        }
    }
    protected void Page_Load(object sender, EventArgs e) {
        CallbackManager.PreRender += new EventHandler<EventArgs>(CallbackManager_PreRender);
    }
    protected override void OnUnload(EventArgs e) {
        CallbackManager.PreRender -= new EventHandler<EventArgs>(CallbackManager_PreRender);
        base.OnUnload(e);
    }
    protected override ContextActionsMenu CreateContextActionsMenu() {
        return new ContextActionsMenu(this, "Edit", "RecordEdit", "ObjectsCreation", "ListView", "Reports");
    }
    #region IHintTemplate Members

    public string Hint {
        get {
            IHintTemplate hintTemplate = TemplateContent as IHintTemplate;
            if(hintTemplate != null) {
                return hintTemplate.Hint;
            }
            return null;
        }
        set {
            IHintTemplate hintTemplate = TemplateContent as IHintTemplate;
            if(hintTemplate != null) {
                hintTemplate.Hint = value;
            }
        }
    }

    #endregion
    #region ICustomControlsPlaceHolder Members
    public Control PlaceHolder {
        get {
            ICustomControlsPlaceHolder placeHolder = TemplateContent as ICustomControlsPlaceHolder;
            if(placeHolder != null) {
                return placeHolder.PlaceHolder;
            }
            return null;
        }
    }
    #endregion
}
